/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Anthares
 */
@Embeddable
public class TradCategPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "CATEG_ID", nullable = false)
    private int categId;

    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "LANG_ID", nullable = false, length = 255)
    private String langId;

    public TradCategPK() {
    }

    public TradCategPK(int categId, String langId) {
        this.categId = categId;
        this.langId = langId;
    }

    public int getCategId() {
        return categId;
    }

    public void setCategId(int categId) {
        this.categId = categId;
    }

    public String getLangId() {
        return langId;
    }

    public void setLangId(String langId) {
        this.langId = langId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) categId;
        hash += (langId != null ? langId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TradCategPK)) {
            return false;
        }
        TradCategPK other = (TradCategPK) object;
        if (this.categId != other.categId) {
            return false;
        }
        if ((this.langId == null && other.langId != null) || (this.langId != null && !this.langId.equals(other.langId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Model.TradCategPK[ categId=" + categId + ", langId=" + langId + " ]";
    }
    
}
